﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Interactivity;
using G.WeiBo.View.ChildWindows;
using System.Windows.Controls.Primitives;

namespace G.WeiBo.Behaviors
{
    public class BrowserImageBehavior : Behavior<ButtonBase>
    {
        protected override void OnAttached()
        {
            base.OnAttached();
            this.AssociatedObject.Click += new RoutedEventHandler(AssociatedObject_Click);
        }

        void AssociatedObject_Click(object sender, RoutedEventArgs e)
        {
            BrowserBigImageChildWindow childWindow = new BrowserBigImageChildWindow();
            childWindow.IsOpen = true;
            childWindow.Url = new Uri(this.AssociatedObject.Tag as string, UriKind.RelativeOrAbsolute);
        }
    }
}
